
  !Primes+

 Important message:

   !Primes+ requires some memory as workspace, which dictates the maximum
   numbers the program can/will handle. The 'default' amount of allocated
   memory is set in the !Run file, but this can be changed by the user to
   suit his/her requirements.
 
   Alternatively you can - 

      a) click on 'Maximum' in the Iconbar Menu - this will automatically
         allocate the maximum amount of memory available on your machine

   OR b) change this allocation dynamically (after !Primes+ has been run)
         - open up the Task-Manager display, go to the 'Dynamic areas'
         section and drag the slider belonging to !Primes+ to a value of
         your choice.

      - see the 'Memory details:' section below.


    If you choose a number that is too big for the program to handle then it
   will abort. Run the !Primes+ program again and then immediately allocate
   more memory, by using one of the methods outlined above.

    By way of example my computer has about 70Mb spare, so I was able to
   find the eight-millionth prime number by dragging the slider as far as it
   would go.

   Note: if you are near the memory limit of your machine you will need to
   decrease the allocation or 'Quit' !Primes+ before running other programs.
   (All memory is returned to the free pool on quitting !Primes+.)


  Speed: (on a SA RiscPC)

   Gets all primes up to 1,000,000 in about 0.13 seconds !

   Some other speed results:
    - gets all primes up to 10,000,000 in 1.57 seconds
    - gets all primes up to 50,000,000 in 9.51 seconds
    - gets all primes up to 100,000,000 in 20.65 seconds

    - the million-th prime is 15,485,863 - found in 3.00 secs
    - the 2 million-th prime is 32,452,843 - found in 6.79 secs
    - the 3 million-th prime is 49,979,687 - found in 10.95 secs.
    - the 4 million-th prime is 67,867,967 - found in 15.35 secs.
    - the 5 million-th prime is 86,028,121 - found in 19.93 secs.
    - the 6 million-th prime is 104,395,301 - found in 24.67 secs.
    - the 7 million-th prime is 122,949,823 - found in 29.52 secs.
    - the 8 million-th prime is 141,650,939 - found in 34.48 secs.

  Memory details:

   1)'All Primes up to a given number X' option requires about 500K per million:
      So  X = 1,000,000 needs about 500K of memory,
          X = 10,000,000 needs about 5000K (=5Mb)
          X = 100,000,000 needs about 50000K (=50Mb) etc

   2)'The N-th Prime number' option requires about 8.7Mb per million:
      So  N = 100,000 will need about 870K of memory
          N = 1,000,000 needs about 8700K (=8.7Mb)
          N = 5,000,000 needs about 43500K (43.5Mb) etc

   3)'All Primes between two numbers X and Y' option does not need much memory,
      provided the difference between X and Y is not too large.

   4)'Prime factors of a given number X' option likewise is no problem.
 


  Notes on factorization:

   Largest integer computer can hold directly is 2,147,483,647 (=2^31-1=&7FFFFFFF)
   so this is the upper limit (for this program).

   Number of factors includes both 1 and the number itself -
   e.g 60 has 12 factors - viz. 1,2,3,4,5,6,10,12,15,20,30,60.

   Euler's function phi(N) is the number of integers in the set
   1,2,3,4,...,N-2,N-1 that are coprime to N (including 1 itself)
   e.g phi(12)=4 since 1,5,7,11 are coprime to 12.

   The number 1862340480 = 2^7*3^2*5*7*11*13*17*19 and the
   number 1745944200 = 2^3*3^3*5^2*7*11*13*17*19 both have 1536
   factors - and this seems to be the maximum for this machine.
   The number 2*3*5*7*11*13*17*19*23 = 223092870 has nine different
   prime factors, and is the maximum the machine can hold.

   Enjoy!

   Copyright :  R.A.Swetman
